#version 460
#extension GL_GOOGLE_include_directive : enable
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require


#include "../../../../core/shader_binding_ID.h"
#include "../../../../core/shader_std.h"
#include "../../../../core/shader_built_in_functions.h"
#include "../../../../core/shader_curve.h" 

layout(points) in;
layout(points, max_vertices=6) out;


layout(location = 0) in vec4 vColor[];
layout(location=1) in S_CurvePoint3D v_CPoint[];
layout(location=5) in vec3 vCameraPos[];
layout(location=6) in uint vType[];
layout(location=7) in mat4 vMatrix[];

layout(location = 0) out vec4 outColor;

out gl_PerVertex {
	vec4	gl_Position;
	float	gl_PointSize;
};



void main(void){
	
	outColor = vColor[0];
	if( ((v_CPoint[0].ID_Type_Color.y >> 16) & 1) != 0 ){
		outColor.rgb += 0.5;
		gl_PointSize = 8.5;
	}
	else {
		gl_PointSize = 6.0;
	}
	gl_Position = vMatrix[0] * vec4(v_CPoint[0].value, 1);
	gl_PointSize = 6.0;
	EmitVertex();

	outColor = vColor[0];
	if( ((v_CPoint[0].ID_Type_Color.y >> 16) & 2) != 0 ){
		outColor.rgb += 0.5;
		gl_PointSize = 8.5;
	}
	else {
		gl_PointSize = 6.0;
	}
	gl_Position = vMatrix[0] * vec4(v_CPoint[0].L_point, 1);
	
	EmitVertex();

	outColor = vColor[0];
	if( ((v_CPoint[0].ID_Type_Color.y >> 16) & 4) != 0 ){
		outColor.rgb += 0.5;
		gl_PointSize = 8.5;
	}
	else {
		gl_PointSize = 6.0;
	}
	gl_Position = vMatrix[0] * vec4(v_CPoint[0].R_point, 1);
	
	EmitVertex();

	EndPrimitive();
}



